var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-38389209-1']);
_gaq.push(['_trackPageview']);

(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = 'https://ssl.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();

function trackCreateAlbum(){
    _gaq.push(['_trackEvent', 'Album', 'created']);
    console.log('Album', 'created');
}

function trackSavePhoto(){
    _gaq.push(['_trackEvent', 'PhotoSave', 'success']);
    console.log('PhotoSave', 'success');
}

function trackUploadPhoto(){
    _gaq.push(['_trackEvent', 'PhotoUpload', 'success']);
    console.log('PhotoUpload', 'success');
}

function trackCreateAlbumError(e){
    _gaq.push(['_trackEvent', 'Album', 'error', e]);
    console.log('Album', 'error', e);
}

function trackSavePhotoError(e){
    _gaq.push(['_trackEvent', 'PhotoSave', 'error', e]);
    console.log('PhotoSave', 'error', e);
}

function trackUploadPhotoError(e){
    _gaq.push(['_trackEvent', 'PhotoUpload', 'error', e]);
    console.log('PhotoUpload', 'error', e);
}

function trackAuthorisationError(e){
    _gaq.push(['_trackEvent', 'Authorisation', 'error']);
    console.log('Authorisation', 'error', e);
}